package com.yzd.learnjava.generics;

public class CovaianAraays {
	public static void main(String[] args) {
		Fruit2[] fruits = new Apple2[10];
		fruits[0] = new Apple2();
		fruits[1] = new Jonathan2();
		try {
			fruits[0] = new Fruit2();
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		try {
			fruits[0] = new Orange2();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	
}

class Fruit2{}
class Apple2 extends Fruit2{}
class Jonathan2 extends Apple2{}
class Orange2 extends Fruit2{}
